package com.liugui.objectoriented;

/**
 * @ClassName: Outer
 * @Author: liugui
 * @Date: 2020-10-26 14:22
 **/
public class Outer {
    public Inner getInner(final String name,String city){
        return new Inner() {
            private String nameStr = name;
            @Override
            public String getName() {
                return nameStr + ":" + city;
            }
        };
    }

    public static void main(String[] args) {
        Outer outer = new Outer();
        Inner inner = outer.getInner("inner","city");
        System.out.println(inner.getName());
    }
}

interface Inner{
    String getName();
}
